package com.rd.common.model;

import lombok.Getter;

@Getter
public enum ResultCode {
    SUCCESS(1, "操作成功"),
    FAIL(0, "请求失败"),
    PARAM_ERROR(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "无权限访问"),
    NOT_FOUND(404, "请求资源不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    INTERNAL_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    
    // 自定义业务错误码
    VALIDATE_FAILED(400101, "参数校验失败"),
    USER_NOT_EXIST(400102, "用户不存在"),
    USER_PASSWORD_ERROR(400103, "用户密码错误"),
    USER_ACCOUNT_LOCKED(400104, "账号已被锁定"),
    TOKEN_EXPIRED(400105, "token已过期"),
    TOKEN_INVALID(400106, "token无效");


//    ROOM_ERROR(500101, "");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}